import http from "@/http";
import { MenuType } from "./MenuModel";

//获取上级菜单
export const getParentApi = () => {
    return http.get("/api/menu/getParent")
}

//新增
export const addApi = (parm: MenuType) => {
    return http.post("/api/menu", parm)
}

//列表
export const getListApi = () => {
    return http.get("/api/menu/list")
}

//编辑
export const editApi = (parm: MenuType) => {
    return http.put("/api/menu", parm)
}

//删除
export const deleteApi = (menuId:string) => {
    return http.delete(`/api/menu/${menuId}`)
}

//查询用户菜单
export const getMenuListApi = (userId: string) => {
    return http.get("/api/menu/getMenuList", { userId: userId })
}
